There is an air conditioner that includes an infrared sensor unit provided in an indoor device to detect a human based on thermal image data acquired by the infrared sensor unit, and controls an operation based on a detection result. Patent Literature 1 describes to determine whether a communication error has occurred at the time of reception of thermal image data transmitted from an infrared sensor unit at each step. If any communication error has not occurred, or although a communication error has occurred, if thermal image data can be acquired by a thermal-image acquisition element group as a result of an instruction to the infrared sensor unit to retransmit the thermal image data in which a communication error has occurred, up to a preset upper limit of the number of communication retries, the thermal image data acquired by the thermal-image acquisition element group at the step is buffered. If a communication error has occurred and thermal image data has not been acquired within the number of communication retries, alternative data is buffered instead of the thermal image data acquired by the thermal-image acquisition element group for the step. If the number of buffering of the alternative data through all the steps is less than a predetermined threshold number, one thermal image of a scanning area is created by using all the pieces of data buffered at all the steps.